This example does not use any server script, so it does not sort, filter and group the rows !
To see how to support server side sort, filter and group run the examples at /Examples/xxx/Paging/ and /Examples/xxx/PagingDLL/.
Server side paging is done by server script that generates the page list and the individual rows on demand. Implementation of server paging is not easy and requires a lot of work on server side!
For more information see Server paging documentation.
TreeGrid provides server side DLL/SO library that provides the most of work to support the server paging,
but it can be used only some cases, see the DLL documentation.
How server root paging works
On start it uploads to data source
Data_Url
actual state of sorting, filtering, grouping and search
and downloads back the list of pages.
The server script should prepare the list of pages according to the uploaded information.
When any page becomes visible due scroll, TreeGrid uploads to data source
Page_Url
the page identification
(and also the sorting, filtering, grouping and search state) and downloads back all the rows for the page.
The server script should find the rows for the page and return them back to the grid.
It can use the information about the grid state or use some data prepared in the first request for the body.
When any grid state of sorting, filtering, grouping or search is changed by a user,
grid reloads the pages list from Data_Url with the new state information and starts again downloading the visible pages.
Server root paging is set by Cfg attribute
Paging
='3' defined in Layout data source (e.g. in Layout_Url).
Both the data sources (Data_ and Layout_) must be used. The Layout must define the whole grid configuration, all columns and all Fixed and Space rows.
The Data must return only pages.
The Data response is a list of pages as list of of <B> tags.
The <B> can contain rows list like page in client paging to fill the page immediately without downloading on demand.
Or it is empty <B> tag as page to be downloaded on demand.
It can have attribute Count as expected count of the rows in the page.
And attribute Name as the page name shown in the right side pager.
Remember, server must return the rows already sorted, grouped and filtered.
The grid on client side does not sort, filter or group the data, just provides interface for users to change the state and after the change it reloads newly arranged data from server. The server side script is not a part of TreeGrid and must be created by developers!.
Although TreeGrid provides many examples that can be used as fundamental to create the server script.
TreeGrid also provides the mentioned DLL/SO library that sorts, filters and groups the data automatically and serves the pages on demand.
Calculations in server paging
If the grid contains some summary rows or cells in fixed / space rows, the data must be precalculated on server side by server script.
The results of the summary functions must be filled as attributes to the <B> tags in format ColNameFuncName='result on page'.
In this tutorial example the toolbar formula sums all values in column named N. So all the pages (<B> tags) must have attribute Nsum='xxx' as sum of all cells in the N column on this page.
The Cfg attribute
OnePage
can be used if the server is not able to provide some or all the features (sort, filter, group).
To use the OnePage, there must be also set AllPages='0' to show only one at a time.
When set OnePage, the feature (sort, filter, group) is done by TreeGrid on client and only on the actually displayed page, so it does not affect the other pages in grid.
Static files
In the most cases the body and the pages are created and served dynamically by some server script.
But it is also possible, like in this tutorial example, to load the body and the pages from static files.
For static file it is required to set Data_Method='Get' and / or Page_Method='Get'.
In this case the data source address supports wildcards according to the page identification and sorting state: *Pos, *id, *Rows, *Sort0, *Sort1, *Sort2.